// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取当前的用户 GET /api/currentUser */
export async function currentUser(options?: { [key: string]: any }) {
    return request('/api/ucUser/current', {
        method: 'POST',
        ...(options || {}),
    });
}


export async function queryHospitalAttestation(params: any) {
    return request('/api/hospitalAttestation/getBySysUser', {
        method: 'get',
    });
}

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
    return request<Record<string, any>>('/api/login/outLogin', {
        method: 'POST',
        ...(options || {}),
    });
}

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
    return request('/api/auth/login', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

export async function queryDictList(params: any) {
    return request('/api/bsDictItem/listByCode', {
        method: 'POST',
        data: params,
    });
}

export async function queryDiseaseTags(params: any) {
    return request('/api/bsDisease/listByEntity', {
        method: 'get',
        data: params,
    });
}

export async function queryHospitalList(params: any) {
    return request('/api/hospital/page', {
        method: 'get',
    });
}

export async function queryDiseaseClassList(params: any) {
    return request('/api/bsDiseaseClass/page', {
        method: 'POST',
        data: params,
    });
}

export async function hospitalDeptlist(params: any) {
    return request('/api/hospitalDept/page', {
        method: 'POST',
        data: params,
    });
}

//病理分型
export async function getBsPathologType(params: any) {
    return request('/api/bsPathologType/page', {
        method: 'POST',
        data: params,
    });
}

export async function hospitalList(params: any) {
    return request('/api/hospital/page', {
        method: 'POST',
        data: params,
    });
}

export async function queryUserVisitors(params: any) {
    return request('/api/userVisitor/page', {
        method: 'POST',
        data: params,
    });
}

export async function doctorList(params: any) {
    return request('/api/doctor/selectPage', {
        method: 'POST',
        data: params,
    });
}

export async function diseaseList(params: any) {
    console.log('params', params);
    return request('/api/bsDisease/page', {
        method: 'POST',
        data: params,
    });
}

export async function queryPublicDept(params: any) {
    console.log('params', params);
    return request('/api/bsDept/page', {
        method: 'POST',
        data: params,
    });
}

export async function queryCaseVisit(params: any) {
    return request('/api/userCase/listByEntity', {
        method: 'get',
        params: params,
    });
}

/** 此处后端没有提供注释 GET /api/notices */
export async function getNotices(options?: { [key: string]: any }) {
    // return request<API.NoticeIconList>('/api/notices', {
    //   method: 'GET',
    //   ...(options || {}),
    // });
}

/** 获取规则列表 GET /api/rule */
export async function rule(
    params: {
        // query
        /** 当前的页码 */
        current?: number;
        /** 页面的容量 */
        pageSize?: number;
    },
    options?: { [key: string]: any },
) {
    return request<API.RuleList>('/api/rule', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

/** 新建规则 PUT /api/rule */
export async function updateRule(options?: { [key: string]: any }) {
    return request<API.RuleListItem>('/api/rule', {
        method: 'PUT',
        ...(options || {}),
    });
}

/** 新建规则 POST /api/rule */
export async function addRule(options?: { [key: string]: any }) {
    return request<API.RuleListItem>('/api/rule', {
        method: 'POST',
        ...(options || {}),
    });
}

/** 删除规则 DELETE /api/rule */
export async function removeRule(options?: { [key: string]: any }) {
    return request<Record<string, any>>('/api/rule', {
        method: 'DELETE',
        ...(options || {}),
    });
}
